package com.alex.springboot.service.impl;

import com.alex.springboot.dao.UserDAO;
import com.alex.springboot.entity.User;
import com.alex.springboot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDAO userDAO;

    @Override
    public int save(User user) {
        return userDAO.save(user);
    }

    @Override
    public int delete(Integer id) {
        return userDAO.delete(id);
    }

    @Override
    public int update(User user) {
        return userDAO.update(user);
    }

    @Override
    public User getById(Integer id) {
        return userDAO.getById(id);
    }

    @Override
    public List<User> selectAll() {
        return userDAO.selectAll();
    }
}
